// CallsTable.h : CallsTable is used to keep track of all the calls made in each procedures.
// Author: Achyut P Balaji
//
#ifndef CALLS_TABLE_H
#define CALLS_TABLE_H

#include"../../SPA_Data_Types.h"

using namespace std;

typedef vector<PROC_INDEX> PROCS;

class CallsTable {
private:
	vector<PROCS> callsList;
	vector<PROCS> callsStarList;

	vector<PROC_INDEX> tempVector;

	static CallsTable *obj;
	CallsTable();
public:
	static CallsTable* getInstance();
	static CallsTable* getFirstInstance();

	BOOLEAN insertCall(PROC_INDEX p1, PROC_INDEX p2);
	BOOLEAN insertCallStar(PROC_INDEX p1,PROC_LIST p);

	BOOLEAN isCalled(PROC_INDEX p1, PROC_INDEX p2);
	BOOLEAN isCalledStar(PROC_INDEX p1, PROC_INDEX p2);

	PROC_LIST* getProcList(PROC_INDEX p);
	PROC_LIST* getList(PROC_INDEX p);

	PROC_LIST* getProcCalled(PROC_INDEX p);
	PROC_LIST* getCallsStar(PROC_INDEX p);

	void initialise(int size);
	void emptyTempVector();
};
#endif